/**
 * Created by hetanhong on 2014/9/2.
 */
(function () {
    var mishushi = [
        {
            roleCode: "007",
            roleName: "秘书一室"
        },
        {
            roleCode: "067",
            roleName: "秘书二室"
        },
        {
            roleCode: "068",
            roleName: "秘书三室"
        },
        {
            roleCode: "069",
            roleName: "秘书四室"
        },
        {
            roleCode: "070",
            roleName: "秘书五室"
        },
        {
            roleCode: "071",
            roleName: "秘书六室"
        },
        {
            roleCode: "072",
            roleName: "秘书七室"
        }
    ]
    var huizong = function (config) {
        this._config = config;
        this._type = this.getConfig("type"); //公文类别
        this._businessType = this.getConfig("businessType");
        this._businessId = this.getConfig("businessId");
        this._id = this.getConfig("id");
        this._taskId = this.getConfig("taskId");
        this._taskName = this.getConfig("taskName"); //流程名称
        this._buttonFlag = this.getConfig("buttonFlag")// 是否展示操作按钮
        this._title = this.getConfig("title");
        this._format = d3.time.format("%Y -%_m -%_d");//格式化时间
        this._screenindex = this.getConfig("screenindex"); //上一步页面来源 1 待办 2 通知 3 应用 4 账户

    };
    if (typeof (Clickmed) === "undefined") {
        Clickmed = {};
    }
    Clickmed.huizong = huizong;
    huizong.prototype.init = function () {
        var me = this;
        getDicts(function (dat) {
            me.Dicts = dat;
            var url = serverURL + "cmcp/user/getCurrentUserInfo";
            PostCP(url, null, function (dat) {
                me.userDat = dat;
                me._orgCode = me.userDat["orgCode"];
            }, function () {
            });
            var url = serverURL + "cmcp/super/getSuperSum";
            var self = {
                id: me._businessId
            };
            console.log(self);
            //   向后台请求数据
            PostCP(url, self, function (dat) {
                me.dat = dat;
                console.log(dat);
                me.draw();
                if (!me._buttonFlag) {
                    var url = serverURL + "cmcp/phone/getApprovalUserInfo";
                    var self = {
                        taskId: me._taskId
                    };
                    PostCP(url, self, function (dat) {
                        console.log(dat);
                        me.button = dat;
                        if (dat)
                            me.showButton();
                    }, function () {
                        Alert("获取数据失败");
                    });
                }
            }, function () {
                window.plugins.getIntent.hide();
                Alert("获取数据失败")
            });
        });


    };
    huizong.prototype.showButton = function () {

        var me = this;
        console.log(me.button);
        var buttons = me.button["button"];
        var warp = d3.select("#scrol .dt_warp");

        /* if (!buttons || !buttons.length) {
         return
         }*/
        var button = warp.append("div").classed("tj_button2", true).classed("qb_btn_bg", true).style({
            "position": "absolute",
            "bottom": "0px"
        });
        var tj_button = button.append("p").style({
            "text-align": "center"
        });


        console.log(buttons);
        for (var name in buttons) {
            console.log(name)
            var input = tj_button.append("input").classed("other", true)
                .attr("action", buttons[name]["action"] || "")
                .attr("type", "button")
                .attr("mark", buttons[name]["mark"])
                .attr("requestUrl", buttons[name]["requestUrl"])
                .attr("value", buttons[name]["name"]).style({
                    width: "26.1%"

                });
            $(input.node()).data("userInfo", buttons[name]["userInfo"] || "");
        }
        $("#scrol_").css({
            height: height - 100 + "px"
        });
        Yscroll.refresh();
        $(".other").on("click", function () {
            if (Flag)
                return;
            Flag = true;
            setTimeout(function () {
                Flag = false;
            }, 500);
            var action = $(this).attr("action");
            var name = $(this).attr("value");
            var mark = $(this).attr("mark");
            var userInfo = $(this).data("userInfo");
            me.requestUrl = $(this).attr("requestUrl");
            me._mark = mark;
            me._action = action;
            me._name = name;
            me._userInfo = userInfo;
            me.buttonClick();
        });
    };
    huizong.prototype.buttonClick = function () {
        var me = this;
        var name = me._name;
        var mark = me._mark;
        var userInfo = me._userInfo;
        var flag = false;
        console.log(userInfo)
        console.log(mark, name)

        if (name.indexOf("办结") > -1 || name.indexOf("完结") > -1 || name.indexOf("添加") > -1 || (mark == "false" && !userInfo)) {


            navigator.notification.confirm('您确定要' + name + '此文件么？', showConfirm, 'OA', ['取消', '确定']);
            function showConfirm(button) {
                if (button == 2) {
                    me.submitBJ();
                }
            }
        }
        return;
    }
    huizong.prototype.submitBJ = function () {
        var me = this;
        var action = me._action;

        if (me._mark == "true" || me._mark == "false") {
            var value = $("textarea").val();
        } else {
            var value = me._mark;
        }
        var url = serverURL + "cmcp/phone/approvalInfo";
        var d1 = this._config.body || d3.select("body");
        var self = {
            approvalFlag: action,
            taskId: me._taskId,
            id: me._businessId,
            businessType: me._typeReal || me._businessType,
            requestUrl: me.requestUrl || null,
            type: me._type,
            roleCodes: me._roleCode,
            mark: value || ""
        };
        if (typeof (me._completeDate) != "number") {
            self["completeDate"] = me._completeDate;
        }
        console.log(self);
        PostCP(url, self, function (data) {
            window.plugins.getIntent.hide();
            console.log(data);
            if (!data) {
                Prompt("操作失败，请重新登录。", 1000);
                return;
            }
            if (data != "success") {
                Prompt("该文件已被处理！", 1000);
                return;
            }

            Prompt("操作成功！", 1000);
            // 成功后返回待办列表

            setTimeout(function () {
                $(".comList").remove();
                $(".mark").remove();
                d3.select(".select").remove();
                d3.selectAll("#scrol").remove();
                Android.back = TempFunction.back;
            }, Transiacion);
            window.localStorage.status = "true";

        }, function () {
            // 失败显示提示信息

            Prompt("操作失败，请重新登录。", 1000);
        })

    };
    huizong.prototype.draw = function () {
        var me = this;
        me.getCode();
        var render = this._config.render || d3.select("body");
        var d1 = this._config.body || d3.select("body");
        var width = this.width;
        var scrol = d1.append("div").classed("scrol", true).style({
            width: "100%",
            height: "100%",
            position: "absolute",
            left: "0px",
            top: "0px"
        }).attr("id", "scrol");
        var warp = scrol.append("div").classed("dt_warp", true).style({
            position: "relative"
        });
        var datong_header = warp.append("div").classed("datong_header", true);

        var go_back = datong_header.append("div").classed("go_back", true);
        go_back.html("<i><img src =../../common/page/images/go_back_ico.png width =16 height=auto></i>返回");
        go_back.on(touch_s, function () {
            $(this).css("background-color", "#005ebf");
        });
        go_back.on(touch_e, function () {
            $(this).css("background-color", "");
            if (typeof (GLJ) != "undefined" && GLJ) {
                window.closeView();
                return;
            }

            d1.selectAll("#scrol").remove();
            setTimeout(function () {

                Android.back = TempFunction.back;
            }, Transiacion);

        });
        function back1() {

            d1.selectAll("#scrol").remove();
            setTimeout(function () {

            }, Transiacion);
            Android.back = TempFunction.back;
        }

        // Android返回键动作
        Android.back = TempFunction.back1 = back1;
        datong_header.append("h1").html(me._taskName || "");
        me.Redraw();
    };
    huizong.prototype.getCode = function () {
        var me = this;
        var url = serverURL + "cmcp/code/getCode";
        PostCP(url, "0018", function (dat) {
            if (!dat) {
                Prompt("获取编号失败")
            }
            console.log(dat);
            me._Code = dat;
        }, function () {
            console.log("error");
        });
    };
    huizong.prototype.Redraw = function () {
        var me = this;
        var warp = d3.select("#scrol .dt_warp");
        var title = me.dat["title"] || "汇总单";
        var scrol_ = warp.append("div").classed("scrol_", true).style({
            width: "100%",
            height: height - 45 + "px",
            postion: "relative",
            overflow: "hidden"
        }).attr("id", "scrol_");
        if (me.userDat && me.userDat["orgCode"]) {
            me._orgCode = me.userDat["orgCode"];
        }

        var datong_con = scrol_.append("div").classed("datong_con datong_con_re", true);
        datong_con.append("div").classed("title", true).style({
            "text-align": "center"
        }).html(title).classed("tongzhiTitle", true);

        var tempIndex = me.dat;
        if (tempIndex["sendDate"]) {
            var time = datong_con.append("div").classed("time", true).html("时间：" + me._format(new Date(tempIndex["sendDate"])));
        }
        var datong_con = datong_con.append("div").classed("phone_cotent", true);
        if (tempIndex["superviseDTOs"] && tempIndex["superviseDTOs"].length) {
            for (var index = 0, j = tempIndex["superviseDTOs"].length; index < j; index++) {

                var ul = datong_con.append("ul");
                var li = ul.append("li").classed("b_btm", true).style({
                    width: "100%"
                });
                var table = li.append("table").attr("cellpadding", "0").attr('cellspacing', "0").style({
                    width: "100%"
                });
                var tempData = tempIndex["superviseDTOs"][index];
                if (tempData["issue"] && tempData["issue"].length) {
                    var tr = table.append("tr");
                    tr.append("td").html("<div>期&nbsp;号</div>").style({
                        width: "20%"
                    });
                    tr.append("td").style({
                        width: "22%"
                    }).append("div").html(tempData["issue"]).classed("extend", true);
                    if (tempData["superCode"] && tempData["superCode"].length) {
                        tr.append("td").html("<div>编&nbsp;号</div>").style({
                            width: "20%"
                        });
                        tr.append("td").attr({
                            width: "22%"
                        }).append("div").html(tempData["superCode"]).classed("extend", true);
                    }
                }
                if (tempData["superDate"]) {
                    var tr = table.append("tr");
                    tr.append("td").html("<div>创&nbsp;建&nbsp;日&nbsp;期</div>").style({
                        width: "20%"
                    });
                    tr.append("td").attr("colspan", 3)
                        .append("div").html(me._format(new Date(tempData["superDate"]))).classed("extend", true);
                }
                if (tempData["completeDate"]) {
                    var tr = table.append("tr");
                    tr.append("td").html("<div>办&nbsp;结&nbsp;日&nbsp;期</div>").style({
                        width: "20%"
                    });
                    tr.append("td").attr("colspan", 3)
                        .append("div").html(me._format(new Date(tempData["completeDate"]))).classed("extend", true);
                }
                if ((tempData["fszOpinion"] && tempData["fszOpinion"].length) || (tempData["szOpinion"] && tempData["szOpinion"].length)) {
                    var report_title = datong_con.append("div").classed("report_title", true).html("领导批示");
                    var szps = tempData["szOpinion"];
                    var fszps = tempData["fszOpinion"] || "";
                    if (szps) {
                        var ldps = szps + "</br>" + fszps;
                    }
                    else {
                        var ldps = fszps;
                    }

                    var ul = datong_con.append("ul");
                    var li = ul.append("li").classed("b_btm", true).style({
                        padding: "5px 0px"
                    });
                    var dl = li.append("dl");
                    dl.append("dd").html(ldps);

                }
                if (tempData["shortUnitOp"] && tempData["shortUnitOp"].length) {
                    var report_title = datong_con.append("div").classed("report_title", true).html("承办单位意见");
                    var ul = datong_con.append("ul");
                    var li = ul.append("li").classed("b_btm", true).style({
                        padding: "5px 0px"
                    });
                    var dl = li.append("dl");
                    dl.append("dd").html(tempData["shortUnitOp"]);

                }
                if (tempData["shortContent"] && tempData["shortContent"].length) {
                    var report_title = datong_con.append("div").classed("report_title", true).html("内容摘要");
                    var ul = datong_con.append("ul");
                    var li = ul.append("li").classed("b_btm", true).style({
                        padding: "5px 0px"
                    });
                    var dl = li.append("dl");
                    dl.append("dd").html(tempData["shortContent"]);
                    //    tr.append("td").attr("colspan", 3).append("div").html(tempData["content"]).classed("extend", true);


                }
                if (tempData["shortRemark"] && tempData["shortRemark"].length) {
                    var report_title = datong_con.append("div").classed("report_title", true).html("备注");
                    var ul = datong_con.append("ul");
                    var li = ul.append("li").classed("b_btm", true).style({
                        padding: "5px 0px"
                    });
                    var dl = li.append("dl");
                    dl.append("dd").html(tempData["shortRemark"]);
                    //  tr.append("td").attr("colspan", 3).append("div").html(tempData["remark"]).classed("extend", true);
                }
                if (tempData["files"] && tempData["files"].length) {
                    var fileList = datong_con.append("div").classed("report_title", true).html("附件");
                    for (var i = 0; i < tempData["files"].length; i++) {
                        var newDiv = datong_con.append("div").classed("newDiv", true)
                            .attr("url", tempData["files"][i]["pdfUrl"]).attr("fileName", tempData["files"][i]["name"]);
                        var len = tempData["files"][i]["pdfUrl"].split(".").length;
                        var extend = tempData["files"][i]["pdfUrl"].split(".")[len - 1];
                        var img = newDiv.append("img").attr("src", "../../common/page/images/" + extend + ".png").attr({
                            width: "25",
                            height: "22"
                        }).style("margin-left", "15px");
                        var file = newDiv.append("p").html(tempData["files"][i]["name"])
                            .attr("url", tempData["files"][i]["pdfUrl"]).attr("fileName", tempData["files"][i]["name"]);
                        newDiv.on("click", function () {
                            var url = $(this).attr("url");
                            if (Flag)
                                return;
                            Flag = true;
                            setTimeout(function () {
                                Flag = false;
                            }, 500);
                            url = serverURL + url.substr(1);
                            var fileName = $(this).attr("fileName");
                            window.openF(url, fileName);
                        });
                    }
                }
                if (!me._buttonFlag) {
                    if (tempData["isRevive"] != "0002") {
                        var button = li.append("p").style({
                            "text-align": "right"
                        }).append("button").style({
                            width: "24%",
                            "min-width":"90px"
                        }).html("生成批示单").attr("fromList", "s").attr("superId", tempData["id"])
                            .attr("issue", tempData["issue"]).attr("noticenterId", "").attr("orgCode", me._orgCode);
                        $(button.node()).data("key", tempData);
                        button.on("click", function () {
                            if (Flag)
                                return;
                            Flag = true;
                            var obj = {};
                            if (me._orgCode == "001") {
                                me._superType = "0001"
                            } else {
                                me._superType = "0002"
                            }
                            me.deleteButton = $(this);
                            me._fromList = $(this).attr("fromList");
                            me._superId = $(this).attr("superId");
                            me._issue = $(this).attr("issue");
                            me._newTtile = "批示事项通知"
                            //  obj["issue"] = $(this).attr("issue");
                            me._noticenterId = $(this).attr("noticenterId");
                            var dat = $(this).data("key");
                            me.leaderPishi(dat);
                            setTimeout(function () {
                                Flag = false;
                            }, 1000);
                        });
                    }

                    ;
                }
                if (index < (j - 1)) {
                    datong_con.append("div").classed("breakLine", true);
                }
            }
        }
        /* 流程跟踪
         */
        var report_title = d3.select(".datong_con_re").append("div").classed("report_title", true).html("流程跟踪");
        report_title.style({
            background: "#f2f2f0",
            color: "#2345e6",
            "border-radius": "10px",
            "margin": "0% 2% 2% 2%"
        })
        report_title.on("click", function () {
            if (Flag)
                return;
            Flag = true;
            me.openNew();

            setTimeout(function () {
                Flag = false;
            }, 500);
        });
        Yscroll = new iScroll("scrol_", {hScrollbar: false, vScrollbar: false});
        window.plugins.getIntent.hide();
    };
    huizong.prototype.leaderPishi = function (obj) {
        var me = this;
        me.createDate = new Date();
        me._content = obj["content"];
        console.log(obj);
        var select = d3.select("body").append("div").classed("select", true).style({
            width: "100%",
            height: "100%",
            background: "#fff",
            position: "absolute",
            left: "0px",
            top: "0px",
            "z-index": 9990,
            "over-follow": "hidden"
        });
        var dt_warp = select.append("div").classed("dt_warp", true);
        var head = dt_warp.append("div").classed("datong_header", true);
        head.append("h1").html(me._taskName);
        var back = head.append("div").classed("go_back", true);
        back.html("<i><img src =../../common/page/images/go_back_ico.png width =16 height=auto></i>返回");
        back.on(touch_s, function () {
            $(this).css("background-color", "#005ebf");
        });
        // 左上角返回按钮 动作
        back.on(touch_e, function () {
            $(this).css("background-color", "");

            setTimeout(function () {
                select.remove();
                // Android返回键动作更改
                Android.back = TempFunction.back1;
            }, 10);
        });
        // Android 返回键动作
        function back2() {
            $(".comList").remove();
            $(".mark").remove();
            setTimeout(function () {
                select.remove();
            }, 500);
            Android.back = TempFunction.back1;
        }

        Android.back = TempFunction.back2 = back2;
        var datong_con = dt_warp.append("div").classed("datong_con", true).attr("id", "datong_con").style({
            height: height - 100 + "px",
            "over-flow": "hidden"
        });
        var content = datong_con.append("div").classed("content", true);
        var content = content.append("div").classed("phone_cotent", true);
        var ul = content.append("ul");
        var li = ul.append("li").classed("b_btm", true).style({
            width: "100%"
        });
        var table = li.append("table").attr("cellpadding", "0").attr('cellspacing', "0").style({
            width: "100%"
        });
        var tr = table.append("tr");

        tr.append("td").html("<div>期&nbsp;号</div>").style({
            width: "25%"
        });
        tr.append("td").style("width", "75%").html(me._issue).classed("extend", true);
        var tr = table.append("tr");

        tr.append("td").html("<div>编&nbsp;号</div>").style({
            width: "25%"
        });
        tr.append("td").style("width", "75%").html(me._Code).classed("extend", true);
        var tr = table.append("tr");

        tr.append("td").html("<div>创&nbsp;建&nbsp;日&nbsp;期</div>").style({
            width: "25%"
        });
        tr.append("td").style("width", "75%").html(me._format(new Date(me.createDate))).classed("extend", true);
        var tr = table.append("tr");

        tr.append("td").html("<div>内&nbsp;容&nbsp;摘&nbsp;要</div>").style({
            width: "25%"
        });
        tr.append("td").style("width", "75%").html(obj["content"].replace(/\n/g, "<br>").replace(/\s/g, "&nbsp")).classed("extend", true);
        var leadString = "";
        var tr = table.append("tr");

        tr.append("td").html("<div>领&nbsp;导&nbsp;意&nbsp;见</div>").style({
            width: "25%"
        });
        var td = tr.append("td").style("width", "75%");
        var button = td.append("button").html(leadString)
            .classed("extend", true).classed("Edit", true)
            .attr("name", "领导意见").attr("type", "button");
        button.on(touch_e, function () {
            var name = $(this).attr("name");
            var html = $(this).html();
            var tempButton = $(this);
            if (Flag)
                return;
            Flag = true;
            setTimeout(function () {
                Flag = false;
            }, 500);
            Edit(name, html, function (tempstr) {
                console.log(tempstr);
                tempButton.html(tempstr);
                me._newContent = tempstr;
                tempScrol.refresh();
            });

        });

        var tj_button = select.append("div").classed("tj_button2", true).classed("qb_btn_bg", true).style({
            bottom: "0px"
        });
        if (me._orgCode == "001") {
            var ensure = tj_button.append("input").classed("btn_agree", true).attr("type", "button")
                .attr("value", "信息科办理");
        } else {
            var ensure = tj_button.append("input").classed("btn_agree", true).attr("type", "button")
                .attr("value", "秘书室办理");
          /*  var tr = table.append("tr");
            tr.append("td").html("<div>选&nbsp;择&nbsp;秘&nbsp;书&nbsp;室</div>").style({
                width: "25%"
            });
            var td = tr.append("td").style("width", "75%");
            var selectM = $("<select></select>");
            selectM.append("<option value=" + ">" + "</option>");
            for (var i = 0; i < mishushi.length; i++) {
                selectM.append("<option value=" + mishushi[i]["roleCode"] + ">" + mishushi[i]["roleName"] + "</option>");
            }
            $(td.node()).append(selectM)*/
        }
        tempScrol = new iScroll("datong_con", {
            hScrollbar: false,
            vScrollbar: false

        });
        ensure.on("click", function () {
            if (Flag)
                return;
            Flag = true;
            setTimeout(function () {
                Flag = false;
            }, 500);
            if (!$(".Edit").html().length) {
                Prompt("请填写意见");
                return;
            }
            if (me._orgCode == "001") {
                me._roleCode = "076"
                me.submit();

            }
            else {
                // 前台写死选择列表
                me._roleCode = null;
                me.selectMishushi();
                return;
                me._roleCode = $("select").val();
                me.submit();
            }

        });

    }
    huizong.prototype.selectMishushi = function () {
        var me = this;

        var select = d3.select("body").append("div").classed("selectMishushi", true).style({
            width: "100%",
            height: "100%",
            background: "#fff",
            position: "absolute",
            left: "0px",
            top: "0px",
            "z-index": 9999,
            "over-follow": "hidden"
        });
        var dt_warp = select.append("div").classed("dt_warp", true);
        var head = dt_warp.append("div").classed("datong_header", true);
        head.append("h1").html(me._taskName);
        var back = head.append("div").classed("go_back", true);
        back.html("<i><img src =../../common/page/images/go_back_ico.png width =16 height=auto></i>返回");
        back.on(touch_s, function () {
            $(this).css("background-color", "#005ebf");
        });
        // 左上角返回按钮 动作
        back.on(touch_e, function () {
            $(this).css("background-color", "");

            setTimeout(function () {
                d3.selectAll(".selectMishushi").remove();
                // Android返回键动作更改
                Android.back = TempFunction.back1;
            }, 10);
        });
        // Android 返回键动作
        function back3() {
            $(".comList").remove();
            $(".mark").remove();
            d3.selectAll(".selectMishushi").remove();

            Android.back = TempFunction.back2;
        }

        Android.back = TempFunction.back3 = back3;
        var datong_con = dt_warp.append("div").classed("datong_con", true).attr("id", "datong_con").style({
            height: height - 44 + "px",
            "over-flow": "hidden"
        });
        datong_con.append("div").classed("report_title", true).html("选择收件人").style({
            "text-align": "center"
        });
        var dist = 122;
        var list = datong_con.append("div").classed("list", true).style({
            width: "100%",
            height: (height - dist) + "px",
            "over-follow": "hidden",
            "margin": "0 auto"
        }).attr("id", "list");
        var table = list.append("div").style({
            display: "table",
            width: "100%"
        }).attr("cellpadding", "0").attr("cellspacing", "0");
        var tr1 = table.append("div").classed("sjr_name", true);
        var ul = tr1.append("ul");
        var menber = mishushi
        for (var j = 0; j < menber.length; j++) {
            var li = ul.append("li")
                .attr("roleCode", menber[j]['roleCode']).attr("userName", menber[j]["roleName"]);
            li.html("<i class= choose_ico></i>" + menber[j]["roleName"]);
            li.on("click", function () {
                if (Flag)
                    return;

                Flag = true;
                setTimeout(function () {
                    Flag = false;
                }, 500);
                $("li").removeClass("sel1");
                $(this).addClass("sel1");
                me._roleCode = $(this).attr("roleCode")
                d3.selectAll("i").classed("choosed_ico", false).classed("choose_ico", true);
                d3.select(this).select("i").classed("choosed_ico", true).classed("choose_ico", false);
            })
        }
        var tj_button = datong_con.append("div").classed("tj_button2", true).classed("qb_btn_bg", true).style({
            bottom: "0px"
        });


        var cancel = tj_button.append("input").classed("btn_back", true).attr("type", "button")
            .attr("value", "取  消");
        cancel.on("click", function () {
            if (Flag)
                return;

            Flag = true;
            setTimeout(function () {
                Flag = false;
            }, 500);
            $(".selectMishushi").remove();
            Android.back = TempFunction.back2;
        });
        var ensure = tj_button.append("input").classed("btn_agree", true).attr("type", "button")
            .attr("value", "确  认");
        ensure.on("click", function () {
            if (Flag)
                return;

            Flag = true;
            setTimeout(function () {
                Flag = false;
            }, 500);
            if (!me._roleCode) {
                Prompt("请选择秘书室");
                return;
            }
            me.submit();
        });
    };
    huizong.prototype.submit = function () {
        var me = this;
        var url = serverURL + "cmcp/dynawork/doPhoneStartSupervises"
        var self = {
            issue: me._issue,
            superCode: me._Code,
            superId: me._superId,
            fromList: me._fromList,
            content: me._content,
            superType: me._superType,
            title: me._newTtile,
            noticenterId: me._noticenterId,
            szOpinion: me._newContent,
            roleCode: me._roleCode
        }
        PostCP(url, self, function (dat) {
            if (!dat) {
                Prompt("提交失败");
                return;
            }
            Prompt("提交成功");
            d3.select(".select").remove();
            d3.select(".selectMishushi").remove();
            me.deleteButton.remove();
            Android.back = TempFunction.back1;
            Yscroll.refresh();
        }, function () {
            Prompt("提交失败");
        });
    };
    huizong.prototype.openNew = function () {
        var me = this;
        var href = location.href;
        var len = href.lastIndexOf("views");
        var url = href.substr(0, len + 6) + "lcgz/lcgz.html?id=" + me._businessId + "&businessType=" + me._businessType + "&screenindex=" + me._screenindex;
        window.openViewC(url);
    };
    huizong.prototype.getConfig = function (key) {
        if (this._config == null) {
            return null;
        } else {
            if (typeof (this._config[key]) != "undefined") {
                return this._config[key];
            } else {
                return null;
            }
        }
    };
})();